<template>
  <div class="app-container">
    <el-card shadow="hover">
      <el-form ref="form" :model="form" :rules="rules">
        <el-form-item label="产业配套企业数" prop="count_industry_company">
          <el-input-number v-model="form.count_industry_company" placeholder="请输入" :min="0"></el-input-number>
        </el-form-item>
        <el-form-item label="园区企业总产值" prop="total_yuanqu_output">
          <el-input-number v-model="form.total_yuanqu_output" placeholder="请输入" :min="0"></el-input-number>
          （单位：万元）
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleSubmit">保存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import {UpdateYuanquZican} from "@/api/upload";

export default {
  name: "town-index",
  data() {
    return {
      form: {
        count_industry_company: 0,//产业配套企业数
        total_yuanqu_output: 0,//园区企业总产值（单位：万元）
      },
      rules: {
        count_industry_company: [{
          required: true,
          message: '产业配套企业数必填'
        }],
        total_yuanqu_output: [{
          required: true,
          message: '园区企业总产值必填'
        }]
      }
    }
  },
  methods: {
    handleSubmit() {
      this.$refs.form.validate().then(() => {
        UpdateYuanquZican(this.form).then(res => {
          this.msgSuccess(res.result?.message || '保存成功')
        })
      })
    }
  }
}
</script>

<style scoped>

</style>
